import os
from pathlib import Path

db_uri = 'mysql+pymysql://oldpan:whnb@localhost:3306/tpp'


class Config:
    DEBUG = True
    SECRET_KRY = 'aItemNamedTpp'
    # database
    SQLALCHEMY_DATABASE_URI = db_uri
    SQLALCHEMY_TRACE_MODIFICATIONS = False
    # path
    BASE_DIR = Path(__file__).resolve().parent.parent
    STATIC_DIR = os.path.join(BASE_DIR, 'static')
    UPLOAD_DIR = os.path.join(STATIC_DIR, 'uploads')
    BGP_DIR = os.path.join(UPLOAD_DIR, 'bgps')
    ICON_DIR = os.path.join(UPLOAD_DIR, 'icon')


class Development(Config):
    ENV = 'development'


class Production(Config):
    DEBUG = False
    ENV = 'production'

if __name__ == '__main__':
    print(Config.STATIC_DIR)
    print(Config.UPLOAD_DIR)
    print(Config.BGP_DIR)
